package com.jzr.medical.db1.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.jzr.medical.common.LayMapper;
import com.jzr.medical.db1.model.TAppVersion;
import com.jzr.medical.db1.vo.AppTypeVersionVo;
import com.jzr.medical.db1.vo.AppVersionVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
/**
 * <p>
 * app软件版本 Mapper 接口 abc
 * </p>
 *
 * @author henry
 * @since 2019-07-22
 */
public interface TAppVersionMapper extends LayMapper<TAppVersion,AppVersionVo,Integer> {
    List<Integer> getIdList(@Param(Constants.WRAPPER) Wrapper wrapper);

    @Select("select * from t_app_version a where a.`status`=1 and a.soft_type=#{softType} ORDER BY a.full_version DESC limit 1")
    AppVersionVo lastVersion(Integer softType);

    @Select("select soft_type as softType,full_version as fullVersion from t_app_version where status=1 order by soft_type,full_version desc")
    List<AppTypeVersionVo> getLastAppCodeList();
}

